#include <iostream>
#include <vector>
using namespace std;
bool isGreatBeautifulNumber(int num) {
    vector<int> factors;
    // 找出所有正因数
    for (int i = 1; i <= num; ++i) {
        if (num % i == 0) {
            factors.push_back(i);
        }
    }
    int factorCount = factors.size();
    // 若因数个数小于 4，肯定不是大美数
    if (factorCount < 4) {
        return false;
    }
    // 枚举 4 个不同正因数的所有组合
    for (int i = 0; i < factorCount; ++i) {
        for (int j = i + 1; j < factorCount; ++j) {
            for (int k = j + 1; k < factorCount; ++k) {
                for (int l = k + 1; l < factorCount; ++l) {
                    int sum = factors[i] + factors[j] + factors[k] + factors[l];
                    if (sum % num == 0) {
                        return true;
                    }
                }
            }
        }
    }
    return false;
}

int main() {
    int K;
    cin >> K;
    for (int i = 0; i < K; ++i) {
        int num;
        cin >> num;
        if (isGreatBeautifulNumber(num)) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
    return 0;
}    